package com.tree;

public class Test {
    public static void main(String[] args){
        //创建树结构从叶子节点开始
        Node node5=new Node(5,null,null);
        Node node4=new Node(4,null,node5);
        Node node7=new Node(7,null,null);
        Node node6=new Node(6,null,node7);
        Node node3=new Node(3,null,null);
        Node node2=new Node(2,node3,node6);
        Node node1=new Node(1,node4,node2);
        BinaryTree binaryTree=new LinkedBinaryTree(node1);
        System.out.println(binaryTree.isEmpty());
        //binaryTree.preOrderTraverse();
        binaryTree.inOrderTraverse();
        binaryTree.postOrderTraverse();
      System.out.println(binaryTree.getHeight());
        System.out.println(binaryTree.size());
        System.out.println(binaryTree.findKey(1));
        binaryTree.levelOrderByStack();
        System.out.println();
        binaryTree.preOrderByStack();


    }
}
